<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta content="telephone=no" name="format-detection" />
    <!-- 留作将来统一添加 -->
    <TEMPLATE>${TEMPLATE}</TEMPLATE>
    <title>模板html</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/data-flex.min.css">
    <style type="text/css">
        body {
            background: rgba(245, 245, 245, 1);
        }

        .vueApp {
            overflow: hidden;
        }

        .m-container-mod {
            margin: 15px;
            padding: 15px;
            background: rgba(255, 255, 255, 1);
            box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.02);
            border-radius: 8px;
        }

        .o-row {
            height: 20px;
            margin-top: 15px;
        }

        .o-row:first-child {
            margin-top: 0;
        }

        .c-key {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
        }

        .c-txt-secondary {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(90, 90, 90, 1);
            line-height: 20px;
        }

        .c-pos-img {
            width: 30px;
            height: 30px;
            min-width: 30px;
            margin-right: 15px;
        }

        .c-user-name {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
        }

        .c-user-phone {
            height: 20px;
            font-size: 14px;
            font-weight: 400;
            color: rgba(161, 165, 177, 1);
            line-height: 20px;
            margin-left: 10px;
        }

        .c-user-address {
            font-size: 14px;
            font-weight: 400;
            color: rgba(63, 64, 70, 1);
            line-height: 20px;
            margin-top: 5px;
        }

        .o-transport-item {
            position: relative;
            padding-left: 15px;
            padding-bottom: 30px;
            border-left: 1px solid #7f7f7f;
        }

        .o-transport-item::before {
            content: "";
            position: absolute;
            left: -5px;
            top: 0;
            width: 10px;
            height: 10px;
            border: 1px solid #7f7f7f;
            box-sizing: border-box;
            border-radius: 50%;
            background: rgb(255, 255, 255);

        }

        .o-transport-item:last-child {
            border-left: 0;
        }

        .c-transport-time {
            line-height: 1;
            font-size: 12px;
            font-weight: 400;
            color: rgba(127, 127, 127, 1);
        }

        .c-transport-state {
            font-size: 15px;
            font-weight: bold;
            color: rgba(25, 25, 25, 1);
            margin-top: 8px;
        }

        .c-transport-detail {
            font-size: 15px;
            font-weight: 400;
            color: rgba(51, 51, 51, 1);
            line-height: 23px;
            margin-top: 10px;
        }
    </style>
</head>

<body>
    <div class="vueApp" v-cloak>
        <div class="m-container-mod">
            <div class="o-row" data-flex="main:justify cross:center">
                <div data-flex="cross:center">
                    <div class="c-key">物流公司</div>
                </div>
                <div class="c-txt-secondary">{{ companyName }}</div>
            </div>
            <div class="o-row" data-flex="main:justify cross:center">
                <div data-flex="cross:center">
                    <div class="c-key">快递单号</div>
                </div>
                <div class="c-txt-secondary">{{ orderNum }}</div>
            </div>
        </div>
        <div class="m-container-mod">
            <div data-flex="cross:center">
                <img class="c-pos-img" src="../../image/ui/address_2.png" alt="">
                <div data-flex-box="1">
                    <div data-flex="cross:center">
                        <div class="c-user-name">{{ userName }}</div>
                        <div class="c-user-phone">{{ userPhone }}</div>
                    </div>
                    <div class="c-user-address">
                        {{ receiverProvinceName }} {{ receiverCityName }} {{ receiverRegionName }}<br>{{ receiverDetailAddress }}
                    </div>
                </div>
            </div>
        </div>
        <div class="m-container-mod">
            <div class="o-transport-item" v-for="item in listData">
                <div class="c-transport-time">{{ item.ftime }}</div>
                <!-- <div class="c-transport-state">{{ item.statusText }}</div> -->
                <div class="c-transport-detail">
                    {{ item.context }}
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/service/service-tool.js"></script>
<script type="text/javascript" src="../../script/service/service-app.js"></script>
<script type="text/javascript" src="../../script/service/service-user.js"></script>
<script type="text/javascript" src="../../script/service/service-logic.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript">
    // html 的引号一律为双引号(""),js 为单引号('')
    var USER, $S, vm, pageParam;
    var orderId = '';
    apiready = function () {
        $S = SERVICE();
        USER = USER();
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');
        pageParam = api.pageParam;
        orderId = pageParam.orderId;
        fnInit();
    };
    // 初始化
    function fnInit() {
        vm = new Vue({
            el: '.vueApp',
            data: {
                companyName: '',
                orderNum: '',
                userName: '',
                userPhone: '',
                receiverProvinceName: '',
                receiverCityName: '',
                receiverRegionName: '',
                receiverDetailAddress: '',
                listData: ''
            }
        });
        getData();
        getAddressData();
    }

    // 获取物流详情数据
    function getData() {
        var url = 'single/oms/logisticbyapi';
        var params = {
            'orderId': orderId
        };
        var callback = function (data) {
            vm.companyName = data.expressName;
            vm.orderNum = data.nu;
            vm.listData = data.data;
        };
        MALLPOST(url, params, callback);
    }

    // 获取用户地址
    function getAddressData(){
        var url = 'single/oms/detail';
        var params = {
            'id': orderId
        };
        var callback = function (data) {
            vm.userName = data.receiverName;
            vm.userPhone = data.receiverPhone;
            vm.receiverProvinceName = data.receiverProvinceName;
            vm.receiverCityName = data.receiverCityName;
            vm.receiverRegionName = data.receiverRegionName;
            vm.receiverDetailAddress = data.receiverDetailAddress;
        };
        MALLGET(url, params, callback);
    }
</script>

</html>